/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Arrays;

/**
 * <p>Project: app2022 - Arr7
 * <p>Powered by webrx On 2022-01-10 09:52:38
 *
* @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Arr7 {
    public static void main(String[] args) {
        int[] a = {1, 50, 60, 22, 33, 99, 66, 3, 100};
        //检查一下数组元素中有没有50
        //
        boolean f = false;
        for (int i : a) {
            if (i == 55) {
                f = true;
                break;
            }
        }
        if (f) {
            System.out.println("有");
        } else {
            System.out.println("没有");
        }

        Arrays.sort(a);
        int c = Arrays.binarySearch(a, 100);
        if (c < 0) {
            System.out.println("没有");
        } else {
            System.out.println("有[" + c + "]");
        }
    }
}
